home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ Sep 89 / Y0040-Pascal Code Generat-Sep89 < prev    next >
Encoding:
Text File  |  1989-09-11  |  846 b   |  33 lines  |  [TEXT/GEOL]

  1. Item    9938900                         8-Sept-89        18:06
  2.  
  3. From:   D0568                           Poseidon Systems, N Menendez,PRT
  4.  
  5. To:     MACAPP.TECH$                    MACAPP Tech
  6.  
  7. Sub:    Pascal Code Generation help
  8.  
  9. In a MacApp program, we were getting an overflow condition when
  10. the following line of code was executed in a method of an object:
  11.  
  12.   (1)  Value := fIntegerField * kConstant;  {bomba}
  13.     
  14. *(    Value: LONGINT, fIntegerField: INTEGER subrange, kConstant = 60)
  15.     
  16. If we change the line to:
  17.     
  18.   (2)          Value := LONGINT(fIntegerField * kConstant);   {still bomba !}
  19.     
  20. However, if we instead code it as:
  21.     
  22.   (3)  Value := LONGINT(fIntegerField) * LONGINT(kConstant);  {it works !!!}
  23.     
  24. Shouldn't the compiler work with cases 1 and 2 ? (Especially with case 2)
  25.  
  26. Thank you for any help you may provide,
  27.  
  28. Norbert
  29. PSI
  30. D0568
  31.  
  32.  
  33.